<script setup lang="ts">
const { queryParams, loading, tableData } = defineProps({
  queryParams: {
    type: Object,
    default: () => ({})
  },
  loading: {
    type: Boolean,
    default: false
  },
  tableData: {
    type: Array,
    default: () => []
  }
});
</script>
<template>
  <div>
    <px-table ref="energeRef" v-loading="loading" :data="tableData">
      <px-table-column type="index" width="50" align="center" />
      <px-table-column label="时间" align="center" prop="time" width="180" :show-overflow-tooltip="true" />
      <px-table-column label="电表名称" align="center" prop="meterName" :show-overflow-tooltip="true" />
      <px-table-column label="表号" align="center" prop="meterNo" width="100" :show-overflow-tooltip="true" />
      <px-table-column label="正向有功（kWh）" align="center" width="150">
        <px-table-column
          :label="queryParams.dataFormat === 'MeterReading' ? '读数' : '消耗'"
          align="center"
          width="150"
          prop="positiveActivePowerStr"
        />
      </px-table-column>
      <px-table-column label="正向无功（kwh）" align="center" width="150">
        <px-table-column
          :label="queryParams.dataFormat === 'MeterReading' ? '读数' : '消耗'"
          align="center"
          width="150"
          prop="positiveReactivePowerStr"
        />
      </px-table-column>
      <px-table-column label="反向有功（kWh）" align="center" width="150">
        <px-table-column
          :label="queryParams.dataFormat === 'MeterReading' ? '读数' : '消耗'"
          align="center"
          width="150"
          prop="reverseActivePowerStr"
        />
      </px-table-column>
      <px-table-column label="反向无功（kWh）" align="center" width="150">
        <px-table-column
          :label="queryParams.dataFormat === 'MeterReading' ? '读数' : '消耗'"
          align="center"
          width="150"
          prop="reverseReactivePowerStr"
        />
      </px-table-column>
      <px-table-column label="功率因数" align="center" width="110">
        <px-table-column label="COSφ" align="center" width="110" prop="powerFactorStr" />
      </px-table-column>
      <px-table-column label="电压（V）" align="center" width="110">
        <px-table-column label="a" align="center" width="110" prop="voltageAStr" />
      </px-table-column>
      <px-table-column label="电压（V）" align="center" width="110">
        <px-table-column label="b" align="center" width="110" prop="voltageBStr" />
      </px-table-column>
      <px-table-column label="电压（V）" align="center" width="110">
        <px-table-column label="c" align="center" width="110" prop="voltageCStr" />
      </px-table-column>
      <px-table-column label="电流（A）" align="center" width="110">
        <px-table-column label="a" align="center" width="110" prop="currentAStr" />
      </px-table-column>
      <px-table-column label="电流（A）" align="center" width="110">
        <px-table-column label="b" align="center" width="110" prop="currentBStr" />
      </px-table-column>
      <px-table-column label="电流（A）" align="center" width="110">
        <px-table-column label="c" align="center" width="110" prop="currentCStr" />
      </px-table-column>
    </px-table>
  </div>
</template>
